projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dcdc526
)
(BUF_PTR_CHAR_POS): New macro.
author
Richard M. Stallman
<rms@gnu.org>
Sat, 25 Jun 1994 22:34:25 +0000
(22:34 +0000)
committer
Richard M. Stallman
<rms@gnu.org>
Sat, 25 Jun 1994 22:34:25 +0000
(22:34 +0000)
src/buffer.h
patch
|
blob
|
history
diff --git
a/src/buffer.h
b/src/buffer.h
index 499a8629afa2b93b0187fbf822954cf17ef074bc..2e2f3fbfe2358ee792a632f2e922a6b2dfd605aa 100644
(file)
--- a/
src/buffer.h
+++ b/
src/buffer.h
@@
-130,6
+130,13
@@
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
((ptr) - (current_buffer)->text.beg \
- (ptr - (current_buffer)->text.beg < (unsigned) GPT ? 0 : GAP_SIZE) \
+ 1)
+
+/* Convert the address of a char in the buffer into a character position. */
+#define BUF_PTR_CHAR_POS(buf, ptr) \
+((ptr) - (buf)->text.beg \
+ - (ptr - (buf)->text.beg < (unsigned) BUF_GPT ((buf)) \
+ ? 0 : BUF_GAP_SIZE ((buf))) \
+ + 1)
\f
struct buffer_text
{